//
//  SettingViewController.swift
//  QualityControlSystem
//
//  Created by Daniel Hu on 1/5/17.
//  Copyright © 2017 com.mask. All rights reserved.
//

import UIKit

class SettingViewController: UITableViewController {
    
    @IBOutlet weak var headerView: UIView!
    
    override func viewDidLoad() {
        super.viewDidLoad()
        tableView.tableFooterView = UIView()
    }
    
    override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        if indexPath.row == 0 {
            tableView.deselectRow(at: indexPath, animated: false)
        } else {
            tableView.deselectRow(at: indexPath, animated: true)
            if indexPath.row == 1 {         //修改密码
                
            } else if indexPath.row == 2 {  //使用帮助
                
            } else if indexPath.row == 3 {  //退出系统
                let vc = UIAlertController(title: "温馨提示", message: "退出质量监管系统？", preferredStyle: .alert)
                let cancel = UIAlertAction(title: "取消", style: .cancel, handler: nil)
                let sure = UIAlertAction(title: "确定", style: .default, handler: {action in
                    self.tabBarController?.dismiss(animated: true, completion: nil)
                })
                vc.addAction(cancel)
                vc.addAction(sure)
                present(vc, animated: true, completion: nil)
            } else if indexPath.row == 4 {  //关于
                
            }
        }
    }
    
}
